package com.springboot.demo.config.demo3;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

/**
 * Create By Alvin on 2018/9/7
 **/
@Configuration
@ComponentScan(basePackages = { "com.springboot.demo.config.demo3" })
//如果不扫描测试中将不会有readConfigdemo这个类
public class ReadConfig {
    @Bean
    //只要在ReadConfigdemo 加入这个注解 这里加不加无所谓
    // @ConfigurationProperties(prefix = "config.test")
    public ReadConfigdemo getReadConfigdemo()
    {
        return new ReadConfigdemo();
    }

}
